* Apply to:  sfmay_2018.xls
* Description:  Tables A2 and A5

clear


import excel "...\2204 JEPS\sfmay_2018.xls", sheet("Sheet1") firstrow


* Demographic Predictors

gen indoth = 0
replace indoth = 1 if party==4
replace indoth = 1 if party==8
replace indoth = . if party==.

gen republican = 0
replace republican = 1 if party>=1 & party<=3
replace republican = . if party==.

gen partyid = 0
replace partyid = 1 if party>=1 & party<=3
replace partyid = 2 if party==4 | party==8
replace partyid = 3 if party>=5 & party<=7
replace partyid = 4 if party==9
replace partyid = . if party==.

gen college = 0
replace college = 1 if education>=4
replace college = . if education==.

gen female = 0
replace female = 1 if gender==2
replace female = . if gender==.

gen latino = 0
replace latino = 1 if race==3
replace latino = . if race==.

gen asian = 0
replace asian = 1 if race==4
replace asian = 1 if race==5
replace asian = . if race==.

gen interest_hi = 0
replace interest_hi = 1 if interest==1
replace interest_hi = . if interest==.

gen interest_lo = 0
replace interest_lo = 1 if interest==3
replace interest_lo = . if interest==.


* Table A2.  Demographics of Sample

* Partisan Affiliation
tab partyid

* Sex
tab female

* Race and Ethnicity
tab race

* Education
tab education

* Political Interest
tab interest

* Ideology
tab ideology

* Political Knowledge
tab know_sco


* Table A5.  Randomization Check

* Partisanship
* Independent/Other
ttest indoth if (treatment1==1 | treatment1==2), by(treatment1)
ttest indoth if (treatment1==1 | treatment1==3), by(treatment1)
ttest indoth if (treatment1==1 | treatment1==5), by(treatment1)

ttest indoth if (treatment1==2 | treatment1==3), by(treatment1)
ttest indoth if (treatment1==2 | treatment1==5), by(treatment1)

ttest indoth if (treatment1==3 | treatment1==5), by(treatment1)


* Republican
ttest republican if (treatment1==1 | treatment1==2), by(treatment1)
ttest republican if (treatment1==1 | treatment1==3), by(treatment1)
ttest republican if (treatment1==1 | treatment1==5), by(treatment1)

ttest republican if (treatment1==2 | treatment1==3), by(treatment1)
ttest republican if (treatment1==2 | treatment1==5), by(treatment1)

ttest republican if (treatment1==3 | treatment1==5), by(treatment1)


* Education
* College Degree
ttest college if (treatment1==1 | treatment1==2), by(treatment1)
ttest college if (treatment1==1 | treatment1==3), by(treatment1)
ttest college if (treatment1==1 | treatment1==5), by(treatment1)

ttest college if (treatment1==2 | treatment1==3), by(treatment1)
ttest college if (treatment1==2 | treatment1==5), by(treatment1)

ttest college if (treatment1==3 | treatment1==5), by(treatment1)


* Gender
* Female
ttest female if (treatment1==1 | treatment1==2), by(treatment1)
ttest female if (treatment1==1 | treatment1==3), by(treatment1)
ttest female if (treatment1==1 | treatment1==5), by(treatment1)

ttest female if (treatment1==2 | treatment1==3), by(treatment1)
ttest female if (treatment1==2 | treatment1==5), by(treatment1)

ttest female if (treatment1==3 | treatment1==5), by(treatment1)


* Race
* Latino
ttest latino if (treatment1==1 | treatment1==2), by(treatment1)
ttest latino if (treatment1==1 | treatment1==3), by(treatment1)
ttest latino if (treatment1==1 | treatment1==5), by(treatment1)

ttest latino if (treatment1==2 | treatment1==3), by(treatment1)
ttest latino if (treatment1==2 | treatment1==5), by(treatment1)

ttest latino if (treatment1==3 | treatment1==5), by(treatment1)


* Chinese/Asian
ttest asian if (treatment1==1 | treatment1==2), by(treatment1)
ttest asian if (treatment1==1 | treatment1==3), by(treatment1)
ttest asian if (treatment1==1 | treatment1==5), by(treatment1)

ttest asian if (treatment1==2 | treatment1==3), by(treatment1)
ttest asian if (treatment1==2 | treatment1==5), by(treatment1)

ttest asian if (treatment1==3 | treatment1==5), by(treatment1)


* Political Interest
* High (Follow Race "Very Closely")
ttest interest_hi if (treatment1==1 | treatment1==2), by(treatment1)
ttest interest_hi if (treatment1==1 | treatment1==3), by(treatment1)
ttest interest_hi if (treatment1==1 | treatment1==5), by(treatment1)

ttest interest_hi if (treatment1==2 | treatment1==3), by(treatment1)
ttest interest_hi if (treatment1==2 | treatment1==5), by(treatment1)

ttest interest_hi if (treatment1==3 | treatment1==5), by(treatment1)


* Low (Follow Race "Not Closely")
ttest interest_lo if (treatment1==1 | treatment1==2), by(treatment1)
ttest interest_lo if (treatment1==1 | treatment1==3), by(treatment1)
ttest interest_lo if (treatment1==1 | treatment1==5), by(treatment1)

ttest interest_lo if (treatment1==2 | treatment1==3), by(treatment1)
ttest interest_lo if (treatment1==2 | treatment1==5), by(treatment1)

ttest interest_lo if (treatment1==3 | treatment1==5), by(treatment1)


* Ideology
* Rating (1 = "Strong progressive", 7 = "Conservative")
ttest ideology if (treatment1==1 | treatment1==2), by(treatment1)
ttest ideology if (treatment1==1 | treatment1==3), by(treatment1)
ttest ideology if (treatment1==1 | treatment1==5), by(treatment1)

ttest ideology if (treatment1==2 | treatment1==3), by(treatment1)
ttest ideology if (treatment1==2 | treatment1==5), by(treatment1)

ttest ideology if (treatment1==3 | treatment1==5), by(treatment1)


* Political Knowledge
* Knowledge Score (0-4)
ttest know_sco if (treatment1==1 | treatment1==2), by(treatment1)
ttest know_sco if (treatment1==1 | treatment1==3), by(treatment1)
ttest know_sco if (treatment1==1 | treatment1==5), by(treatment1)

ttest know_sco if (treatment1==2 | treatment1==3), by(treatment1)
ttest know_sco if (treatment1==2 | treatment1==5), by(treatment1)

ttest know_sco if (treatment1==3 | treatment1==5), by(treatment1)

* End



